package day1106_2;

import java.io.*;

public class F1 {

    public static void main(String[] args) throws IOException {
        FileInputStream  fis=new FileInputStream("D:\\eclipse-jee-2023-03-R-win32-x86_64.zip");
        //BufferedInputStream bis=new BufferedInputStream(fis);
        //1.BufferedInputStream可以加快文件的读取效率(不能单独用)
        FileOutputStream fos=new FileOutputStream("D:\\eclipse2.zip");
        //BufferedOutputStream bos=new BufferedOutputStream(fos);//2.

        //2.用BufferedInputStream从视频中读一些二进制放入bs中
        byte[]  bs=new byte[1024];
        int len=0;
        while(  (len=fis.read(bs))  !=  -1  ){
            fos.write(bs, 0, len);//2.
        }

        //bis.close();//底层会自动调用fis.close()
        fis.close();
        //bos.close();
        fos.close();
        System.out.println("读取完毕");

    }

}





